package simple.demo.springintegration.demo.chapter5;

import java.util.concurrent.Future;

import org.springframework.integration.Message;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;

public class SimpleAsyncServiceActivatorForQueueChannel {

	@Async
	@ServiceActivator
	public Message<Object> handleMessage(Message<String> msg) throws Exception {
		Message<Object> output = new SimpleDelayedHandler().justDelay(MessageBuilder.withPayload((Object)msg.getPayload()).build());
		
		//System.out.println("internal output = " + output);
		
		return output;
	}
	
}
